package ooexercise04;
public class Master {
    void feed(Animal animal) {
        animal.eat();
        animal.drink();
    }

    Animal o = new Dog("小黑", "黑", 5);
    Dog d = (Dog) o;
    Swim s = (Swim) o;

}
/*
public class Master {
    void feed(Animal animal) {
        animal.eat();
        animal.drink();
    }

    Animal o = new Dog("小黑", "黑", 5);
    Dog d = (Dog) o;
    Swim s = (Swim) o;

}

 */

